<?php

if ($_F->compareToken($data1, $SESSION_WRITE)) {

    $activation_key = $_F->makeActivationKey($id, $pass1, $nick_name);

    $field = "user_num,user_id,user_pass,user_nick,user_email,user_level,user_point,reg_date,activation_key,persistance_key,ip_addr";
    $value = "'','$id',password('$pass1'),'$nick_name','{$email}@{$email2}',1,50,now(),'$activation_key','$activation_key','{$_SERVER['REMOTE_ADDR']}'";
    if (!$r->db->query("insert into $TABLE ($field) values ($value)")) {
        throw new Exception("<br>file : " . __FILE__ . "<br>line : " . __LINE__ . "<br>sql insert 에러");
    }
    $r->db->close();
} else {
    throw new Exception("<br>file : " . __FILE__ . "<br>token 불일치");
}